<?php
// ==============================================================================================
// Licensed under the GNU GPLv3 (LICENSE.txt)
// ==============================================================================================
// @author     WEBO Software (http://www.webogroup.com/)
// @version    1.2.1
// @copyright  Copyright &copy; 2009-2010 WEBO Software, All Rights Reserved
// ==============================================================================================
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.plugin.plugin');
/**
 * Web Optimizer system plugin
 */
class plgSystemWeboSiteInSight extends JPlugin {
/* optimization configuration */
	var $_options;
/* load options and make all changes on the server side */
	function plgSystemWeboSiteInSight(&$subject, $config) {
		global $site_insight_controller, $mainframe;
		if (!$mainframe->isAdmin()) {
			parent::__construct($subject, $config);
			include_once(JPATH_ROOT . '/components/com_webositeinsight/controller/siteinsight.php');
			$site_insight_controller = new SiteInSightController();
			$site_insight_controller->widgetEventHandler('onStart');
		}
	}
/* Prepare content */	
	function onAfterRender() {
		global $site_insight_controller;
		$content = $site_insight_controller->widgetEventHandler('onBeforeEnd', JResponse::toString());
		JResponse::setBody($content);
	}
}
